package cn.loan.tools;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class PropertiesTool {

    private static Properties properties = null;

    static {
        try{
            properties = new Properties();
            InputStream inputStream=PropertiesTool.class.getClassLoader().getResourceAsStream("message/message.properties");
            InputStreamReader inputStreamReader=new InputStreamReader(inputStream,"UTF-8");
            properties.load(inputStreamReader);
        }catch (IOException io){
            io.printStackTrace();
        }
    }


    public static final String getPropertiesContent(String propertiesKey) {
        return properties.getProperty(propertiesKey);
    }

    public static void main(String[] args) {
        final String message = getPropertiesContent("message");
        System.out.println(message);
    }

}